home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / DHTML - Scrollers / cursor-scroller.izs < prev    next >
Text File  |  2005-09-02  |  4KB  |  128 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Cursor Scroller
  4. <!/TITLE>
  5.  
  6. <!BROWSER>IE5+<!/BROWSER>
  7.  
  8. <!DESCRIPTION> This lonely scroller follows your mouse around, ensuring that the message it carries won't be missed by your visitors. And when that time comes for it to leave the scene, two methods are available to accomplishing its removal- either automatically after x seconds, or by double clicking your mouse.
  9. <!/DESCRIPTION> 
  10.  
  11. <!CATEGORY>scrollers<!/CATEGORY>
  12.  
  13. <!SCRIPT>
  14. <!-- START OF SCRIPT -->
  15. <!-- Step 1: Add the following into the <BODY> section of your page: -->
  16. <SCRIPT language="JavaScript1.2"> 
  17. <!--
  18.  
  19. /*
  20. Cursor scroller script- By Dynamicdrive.com
  21. For full source, Terms of service, and 100s DTHML scripts
  22. Visit http://www.dynamicdrive.com
  23. */
  24.  
  25. //1) set message to display
  26. var scroller_msg='Welcome to Dynamic Drive, the premier DHTML code library online!'
  27. //2) set whether message should auto disappear after x seconds (0=perpetual).
  28. //Note that double clicking page will also dismiss message
  29. var dismissafter=0
  30.  
  31. function ietruebody(){
  32. return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
  33. }
  34.  
  35. var initialvisible=0
  36. if (document.all)
  37. document.write('<marquee id="curscroll" style="position:absolute;width:150px;border:1px solid black;font-size:14px;background-color:white;visibility:hidden">'+scroller_msg+'</marquee>')
  38.  
  39. function followcursor(){
  40. //move cursor function for IE
  41.  
  42. if (initialvisible==0){
  43. curscroll.style.visibility="visible"
  44. initialvisible=1
  45. }
  46.  
  47. curscroll.style.left=ietruebody().scrollLeft+event.clientX+10
  48. curscroll.style.top=ietruebody().scrollTop+event.clientY+10
  49. }
  50.  
  51. function dismissmessage(){
  52. curscroll.style.visibility="hidden"
  53. }
  54.  
  55.  
  56. if (document.all){
  57. document.onmousemove=followcursor
  58. document.ondblclick=dismissmessage
  59. if (dismissafter!=0)
  60. setTimeout("dismissmessage()",dismissafter*1000)
  61. }
  62.  
  63. //-->
  64.  </SCRIPT>
  65. <!-- Step 2: Inside the <BODY> tag itself, add the below code to it, as follows: -->
  66. <BODY style="width:100%;overflow-x:hidden;overflow-y:scroll">
  67. <!-- END OF SCRIPT -->
  68. <!/SCRIPT>
  69.  
  70. <!PREVIEW>
  71. <!-- START OF SCRIPT -->
  72.  
  73. <!-- Step 1: Add the following into the <BODY> section of your page: -->
  74. <SCRIPT language="JavaScript1.2"> 
  75. <!--
  76.  
  77. /*
  78. Cursor scroller script- By Dynamicdrive.com
  79. For full source, Terms of service, and 100s DTHML scripts
  80. Visit http://www.dynamicdrive.com
  81. */
  82.  
  83. //1) set message to display
  84. var scroller_msg='Welcome to Dynamic Drive, the premier DHTML code library online!'
  85. //2) set whether message should auto disappear after x seconds (0=perpetual).
  86. //Note that double clicking page will also dismiss message
  87. var dismissafter=0
  88.  
  89. function ietruebody(){
  90. return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
  91. }
  92.  
  93. var initialvisible=0
  94. if (document.all)
  95. document.write('<marquee id="curscroll" style="position:absolute;width:150px;border:1px solid black;font-size:14px;background-color:white;visibility:hidden">'+scroller_msg+'</marquee>')
  96.  
  97. function followcursor(){
  98. //move cursor function for IE
  99.  
  100. if (initialvisible==0){
  101. curscroll.style.visibility="visible"
  102. initialvisible=1
  103. }
  104.  
  105. curscroll.style.left=ietruebody().scrollLeft+event.clientX+10
  106. curscroll.style.top=ietruebody().scrollTop+event.clientY+10
  107. }
  108.  
  109. function dismissmessage(){
  110. curscroll.style.visibility="hidden"
  111. }
  112.  
  113.  
  114. if (document.all){
  115. document.onmousemove=followcursor
  116. document.ondblclick=dismissmessage
  117. if (dismissafter!=0)
  118. setTimeout("dismissmessage()",dismissafter*1000)
  119. }
  120.  
  121. //-->
  122.  </SCRIPT>
  123. <!-- Step 2: Inside the <BODY> tag itself, add the below code to it, as follows: -->
  124. <BODY style="width:100%;overflow-x:hidden;overflow-y:scroll">
  125. <!-- END OF SCRIPT -->
  126. <!/PREVIEW>
  127.  
  128. <!RELATED>NONE<!/RELATED>